import { TextLoader } from "langchain/document_loaders/fs/text";
import { MarkdownTextSplitter } from "langchain/text_splitter";

const loader = new TextLoader("data/markdown语法.md");

const docs = await loader.load();

const splitter = new MarkdownTextSplitter({
  chunkSize: 300,
  chunkOverlap: 0,
});

const result = await splitter.splitDocuments(docs);

console.log(result);
